package org.aileen.springmvc.mapper;

import org.aileen.springmvc.model.MessageInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MessageInfoMapper {
    /**
     * 添加留言
     */

    //插入的实现注解
    @Insert("insert into message_info (`from` , `to` , `message`) values " +
            "(#{from} , #{to} , #{message})")
    //方法声明:
    Integer insertMessage(MessageInfo messageInfo );

    /**
     * 查询留言列表
     */
    @Select("select * from message_info where delete_flag = 0")
    //方法声明:
    List<MessageInfo> queryMessage();
}
